<template>
  <div>
    <LazyLoadTab v-model="activeName" :tabMenus="menus" destroyOnClose></LazyLoadTab>
  </div>
</template>
<script>
export default {
  props: {
    vin: String,
    ownerNo: String,
    remindSource: Number,
    visitType: Number
  },
  data() {
    return {
      activeName: this.getTabTitle(),
      menus: this.createdMenus()
    };
  },
  // mounted(){
  //   alert(this.visitType);
  // },
  methods: {
    createdMenus() {
      return [
        {
          title: this.getTabTitle(),
          path: 'customerRepair/customerCare/maintenanceRemind/vth',
          params: {
            vin: this.vin,
            ownerNo: this.ownerNo,
            remindSource: this.remindSource,
            visitType: this.visitType
          }
        },
        {
          title: '车辆回访历史',
          path: 'customerRepair/customerCare/maintenanceRemind/vths',
          params: {
            vin: this.vin,
            ownerNo: this.ownerNo
          }
        }
      ];
    },
    getTabTitle() {
      switch (this.visitType) {
        case 15721001:
          return '售后回访';
          break;
        case 15721002:
          return '销售回访';
          break;
        case 15721003:
          return '二手车回访';
          break;
        case 15721004:
          return '活动回访';
          break;
        case 15721005:
          return '潜客回访';
          break;
        case 15721006:
          return '战败回访';
          break;
      }
    }
  }
};
</script>
